package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.com.api.entity.ApiT_token;

//DAO
public interface T_tokenMapperBase {

	// 根据id查看
	@Select("SELECT * FROM t_token  WHERE id = #{id}")
	public ApiT_token findT_tokenById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM T_token")
	public List<ApiT_token> findT_tokens();

	// 添加
	@Insert("INSERT INTO t_token (userid, memberid, token, longitude, latitude, role, operatedate) VALUES (#{userid}, #{memberid}, #{token}, #{longitude}, #{latitude}, #{role}, #{operatedate})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertT_token(ApiT_token t_token);

	// 修改
	@Update("UPDATE t_token SET userid = #{userid}, memberid = #{memberid}, token = #{token}, longitude = #{longitude}, latitude = #{latitude}, role = #{role}, operatedate=#{operatedate} WHERE id = #{id}")
	public int updateT_token(ApiT_token t_token);

	// 删除
	@Delete("DELETE FROM t_token  WHERE id = #{id}")
	public int deleteT_token(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
